package com.demo.client.service;

import com.demo.client.service.back.ServerServicesBack;
import com.demo.common.entity.UserDemo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author tianzhuang
 * @version 1.0
 * @date 2021/12/13 11:33
 */
@FeignClient(value = "server", fallback = ServerServicesBack.class)
public interface ServerServices {

    /**
     * 必须要加@RequestParam，否则会报错（不支持get请求）
     *
     * @param val
     * @return
     */
    @GetMapping("/server/testGetServer")
    String testGetMethod(@RequestParam("val") String val);


    @PostMapping("/server/testPostServer")
    UserDemo testGetMethod(UserDemo userDemo);
}
